/*
 *  session_dispatcher.h
 */

#ifndef SESSION_DISPATCHER_H
#define SESSION_DISPATCHER_H

#include <string>
#include <vector>
#include "../../common/src/message_queue.h"
#include "../../common/src/mutex.h"
#include "../../common/src/runnable.h"
#include "../../common/src/session.h"
#include "../../common/src/synchro_list.h"
#include "../../common/src/socket.h"

// Cross reference class forward declaration
class ServerApp;

class SessionDispatcher : public Runnable {
public:
    SessionDispatcher(ServerApp* app, Socket* sock);
    ~SessionDispatcher();
    void run();
private:
    static const int LISTEN_BACKLOG = 5;
    static int id;
    static std::string nextID();
    ServerApp* app;
    Socket* sock;
};

#endif  //SESSION_DISPATCHER_H

//{+}

